package priv.yiyuan.example.design.wrapper;

/**
 * 风险评估装饰器
 * <p>
 * 装饰器模式-具体装饰器
 *
 * @author YiYuan
 * @data 2025/9/2
 * @apoNote
 */
public class RiskAssessmentDecorator extends PaymentDecorator {

    public RiskAssessmentDecorator(PaymentStrategy decoratedPayment) {
        super(decoratedPayment);
    }

    @Override
    public void pay(double amount) {
        System.out.println("执行风险评估...");

        if (amount > 1000) {
            System.out.println("金额较大, 建议进行二次验证。");
        }
        super.pay(amount);

        System.out.println("风险评估完成。");
    }

    @Override
    public String getDescription() {
        return super.getDescription() + " + 风险评估";
    }
}
